public class Test {
    public static void main(String[] args) {
        String str = "aaAA";
        int x = 0;
        int size = 0;
        Boolean b = null;
        char[] ch = new char[50];
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            for (int j = 0; j <= size; j++) {
                b = true;
                if (c == ch[j]) {
                    b = false;
                    break;
                }
            }
            if (b) {
                ch[x] = c;
                size++;
                x++;
            }
        }
        String g = new String(ch,0,size);
        System.out.println(g);
    }
}